<template>
  <el-dialog
    v-model="store.addModel"
    title="添加工作任务"
    :before-close="
      (done) => {
        store.rowData = {};
        done();
      }
    "
  >
    <template #footer>
      <el-form :model="store.rowData" label-width="120px">
        <el-form-item label="工作名称">
          <el-input v-model="store.rowData.task" />
        </el-form-item>
        <el-form-item label="编号">
          <el-input v-model="store.rowData.code" />
        </el-form-item>
        <el-form-item label="父工程ID">
          <el-input v-model="store.rowData.parent" />
        </el-form-item>

        <el-form-item label="开始时间">
          <el-col :span="8">
            <el-date-picker
              v-model="store.rowData.startTime"
              type="date"
              placeholder="Pick a date"
              style="width: 100%"
              format="YYYY/MM/DD"
              value-format="x"
            />
          </el-col>
          <el-col :span="3" class="text-center">
            <span class="text-gray-500">结束时间:</span>
          </el-col>
          <el-col :span="8">
            <el-date-picker
              v-model="store.rowData.endTime"
              placeholder="Pick a time"
              style="width: 100%"
              format="YYYY/MM/DD"
              value-format="x"
            />
          </el-col>
        </el-form-item>
        <el-form-item label="工期">
          <el-input v-model="store.rowData.taskTime" />
        </el-form-item>
      </el-form>
      <div class="dialog-footer">
        <el-button @click="store.addModel = false">取消</el-button>
        <el-button type="primary" @click="props.submit">确认</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { onMounted, ref } from "vue";
import { store } from "../store.js";
const props = defineProps({ submit: Function });
onMounted(() => {});
</script>
<style scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>
